package com.cheng.snake;

//本游戏采用相对坐标，将500*500的换算成25*25的方块
public class Rectangle
{
    private int absX = -30;
    private int absY = -30;
    private int X;
    private int Y;

    public Rectangle()
    {
    }

    public Rectangle(int x, int y)
    {
        setX(x);
        setY(y);
    }

    public int getAbsX()
    {
        return absX;
    }

    public int getAbsY()
    {
        return absY;
    }

    public int getX()
    {
        return X;
    }

    public void setX(int x)
    {
        X = x;
        absX = 20*(x - 1);
    }

    public int getY()
    {
        return Y;
    }

    public void setY(int y)
    {
        Y = y;
        absY = 20*(y - 1);
    }
}
